AC_PREREQ([2.61])
AC_INIT([], [booby])
AC_CONFIG_AUX_DIR([tools])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign
		  -Wall
		  dist-bzip2
		  no-dist-gzip])
AM_SILENT_RULES([yes])

# If the user didn't supplied a CFLAGS value,
# set an empty one to prevent autoconf to stick -O2 -g here.
test -z "$CFLAGS" && CFLAGS=
test -z "$CXXFLAGS" && CXXFLAGS=

AC_LANG(C++)

AC_CHECK_HEADERS([boost/shared_ptr.hpp], , AC_MSG_ERROR("missing boost/shared_ptr library"))
AC_CHECK_HEADERS([boost/enable_shared_from_this.hpp], , AC_MSG_ERROR("missing boost/enable_shared_from_this library"))
AC_CHECK_HEADERS([boost/array.hpp], , AC_MSG_ERROR("missing boost/array library"))
AC_CHECK_HEADERS([boost/unordered_map.hpp], , AC_MSG_ERROR("missing boost/unordered_map.hpp))

#missing boost::asio and boost::thread check and tbb

AC_CHECK_LIB([SDL], [main],, AC_MSG_ERROR("missing SDL library"))
AC_CHECK_LIB([GL], [glClearIndex],, AC_MSG_ERROR("missing GL library"))
AC_CHECK_LIB([GLU], [gluLookAt],, AC_MSG_ERROR("missing GLU library"))
AC_CHECK_LIB([glut], [glutInit],, AC_MSG_ERROR("missing GLUT library"))
AC_CHECK_LIB([GLEW], [glewInit],, AC_MSG_ERROR("missing GLEW library"))
AC_CHECK_LIB([xml2], [xmlCleanupParser],, AC_MSG_ERROR("missing XML2 library"))

AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB

AC_CONFIG_FILES([
	Makefile
        common/Makefile
        client/Makefile
        server2/Makefile
	])

AC_OUTPUT
